package ua.epam.muzalevskiy.traction.commands;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import ua.epam.muzalevskiy.traction.configuretion.PagePathConfigurer;
import ua.epam.muzalevskiy.traction.configuretion.LocaleHelper;

/**
 * <code>NoCommand</code> class is the <code>Command</code> interface 
 * implementation, that realized <code>Command</code> pattern.
 * Current command will work if value of <code>command</code> parameter of
 * current <code>HttpServletRequest</code> is <code>null</code>.
 *
 * @author Muzalevskiy Vitaliy
 * @see Command
 */
public class NoCommand implements Command {

    @Override
    public String execute(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        LocaleHelper.setViewValues(request);
        String page = PagePathConfigurer.getInstance()
                        .getProperty(PagePathConfigurer.INDEX_PAGE);
        return page;
    }
    
}
